package com.lagou.job.consumer;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;
import java.util.Optional;

/**
 * 日志收集消费者
 * @author yzh
 */
@Component
public class JobLogConsumer {

    @KafkaListener(topics = "tp_individual")
    public void getMessage(ConsumerRecord<Integer, String> consumerRecord) {
        Optional<String> value = Optional.ofNullable(consumerRecord.value());
        System.out.println("---------------"+value.get()+"---------------");
    }
}
